﻿using System;
using System.Collections.Generic;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.nodes.hive;

namespace SharpSqlAnalyzer.stmt.hive
{
	// Token: 0x020001C6 RID: 454
	public class THiveRevokeRole : TCustomSqlStatement
	{
		// Token: 0x06000F28 RID: 3880 RVA: 0x0030B2D0 File Offset: 0x003094D0
		public THiveRevokeRole(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.ssthiveRevokeRole;
		}

		// Token: 0x170002CE RID: 718
		// (get) Token: 0x06000F29 RID: 3881 RVA: 0x0030B2E4 File Offset: 0x003094E4
		// (set) Token: 0x06000F2A RID: 3882 RVA: 0x0030B2EC File Offset: 0x003094EC
		public virtual TObjectNameList RoleList
		{
			get
			{
				return this.roleList;
			}
			set
			{
				this.roleList = value;
			}
		}

		// Token: 0x170002CF RID: 719
		// (get) Token: 0x06000F2B RID: 3883 RVA: 0x0030B2F5 File Offset: 0x003094F5
		// (set) Token: 0x06000F2C RID: 3884 RVA: 0x0030B2FD File Offset: 0x003094FD
		public virtual List<THivePrincipalName> Principals
		{
			get
			{
				return this.principals;
			}
			set
			{
				this.principals = value;
			}
		}

		// Token: 0x06000F2D RID: 3885 RVA: 0x0030B308 File Offset: 0x00309508
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			THiveGrantRoleSqlNode thiveGrantRoleSqlNode = (THiveGrantRoleSqlNode)this.rootNode;
			this.roleList = thiveGrantRoleSqlNode.RoleList;
			this.principals = thiveGrantRoleSqlNode.Principals;
			return 0;
		}

		// Token: 0x06000F2E RID: 3886 RVA: 0x0030B34C File Offset: 0x0030954C
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000F2F RID: 3887 RVA: 0x0030B35C File Offset: 0x0030955C
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.roleList != null)
			{
				this.roleList.accept(v);
			}
			if (this.principals != null)
			{
				foreach (THivePrincipalName thivePrincipalName in this.principals)
				{
					thivePrincipalName.acceptChildren(v);
				}
			}
			v.postVisit(this);
		}

		// Token: 0x04001360 RID: 4960
		private TObjectNameList roleList;

		// Token: 0x04001361 RID: 4961
		private List<THivePrincipalName> principals;
	}
}
